A introduction of computer-system organization

Booting啟動 :

OS3

@ booting vs. bootstrap
booting:載入核心程式來使電腦開始運作
bootstrap (在ROM內):可以載入kernel至記憶體中,並執行此kernel
booting是一種動作,bootstrap是一個程式 

@ 作法 :
當電腦電源開啟時,啟動載入程式即開始工作,它首先將作業系統載入電腦的內部記憶體
中,但有些操作系統的程式可儲存在電腦ROM的其他區域,或外在的磁碟設備中。

翻譯 :
韌體(Firmware)
唯讀記憶體(Read-Only Memory, ROM)

中斷Interrupts 介紹 :

程式向系統要求服務的工具

An operating system is interrupt driven
作業系統 可視為一種 中斷驅動系統(interrupt driven)

下面那張圖的解釋 & Interrupt Handling Procedure :

  1. Save interrupt information
  2. OS determines which type of interrupt has occurred

    • Polling (ch13.2.1)

    • Vectored interrupt system

  3. Call the corresponding對應 handlers (Interrupt Service Routine)
  4. Return to "the interrupted job" by the restoring important information
當硬體或軟體傳來優先事件信號時,立即停止正在執行的工作,轉向優先執行該事件,

並把被中斷程式的位址傳到interrupt table,
等kernel做完傳回資料,就不會忘記剛剛做到哪裡

interrupt vector (table) :

紀錄 interrupt 在哪個程式執行到哪(哪個記憶體片段)

contains the memory address(es) of all the service routines (ISR)

採用Stack方法將中斷時每一步驟之位址依序紀錄於特定堆疊中
,等待中斷事件執行完畢後,在由堆疊中取得各位址,反序找到中斷位址
,繼續執行原來之工作

OS4

interrupt 分類 :

External interrupt屬於Hardware interrupt
Internal interrupt有時有人說屬於Software interrupt
System calls另成一類
這只是分類的問題

Storage Structure

Main memory

Magnetic disks硬碟

P1

Storage Hierarchy

• Speed
• Cost
• Size
• Non-volatile or volatility揮發性(電腦關機就沒了)
  • Caching : Information in use copied from slower to faster storage temporarily

P2

I/O Structure

透過觸發interrupt來完成

results matching ""

    No results matching ""